home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-12-08 | 39.6 KB | 1,099 lines | [TEXT/R*ch] |
- C.S.M.P. Digest Thu, 15 Oct 92 Volume 1 : Issue 185
-
- Today's Topics:
-
- Adding Balloon help
- Problems in Macintosh Programming Secrets
- Animated Cursor
- Q: GrayRgn + Menu bar region
- Need small example of playing a sound in THINK C.
- INIT Idea/Request
- UseResFile() problems with CTB Tools
- Drawing Icons in Modal Dialogs?
- CTB undocumented routines and Think Libs
-
-
-
- The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
-
- The digest is a collection of article threads from the internet newsgroup
- comp.sys.mac.programmer. It is designed for people who read c.s.m.p. semi-
- regularly and want an archive of the discussions. If you don't know what a
- newsgroup is, you probably don't have access to it. Ask your systems
- administrator(s) for details. (This means you can't post questions to the
- digest.)
-
- Each issue of the digest contains one or more sets of articles (called
- threads), with each set corresponding to a 'discussion' of a particular
- subject. The articles are not edited; all articles included in this digest
- are in their original posted form (as received by our news server at
- cs.uoregon.edu). Article threads are not added to the digest until the last
- article added to the thread is at least one month old (this is to ensure that
- the thread is dead before adding it to the digest). Article threads that
- consist of only one message are generally not included in the digest.
-
- The entire digest is available for anonymous ftp from ftp.cs.uoregon.edu
- [128.223.8.8] in the directory /pub/mac/csmp-digest. Be sure to read the
- file /pub/mac/csmp-digest/README before downloading any files. The most
- recent issues are available from sumex-aim.stanford.edu [36.44.0.6] in the
- directory /info-mac/digest/csmp. If you don't have ftp capability, the sumex
- archive has a mail server; send a message with the text '$MACarch help' (no
- quotes) to LISTSERV@ricevm1.rice.edu for more information.
-
- The digest is also available via email. Just send a note saying that you
- want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
- automatically receive each new issue as it is created. Sorry, back issues
- are not available through the mailing list.
-
- Send administrative mail to mkelly@cs.uoregon.edu.
-
-
- -------------------------------------------------------
-
- From: rae@Alias.com (Reid Ellis)
- Subject: Adding Balloon help
- Date: 3 Sep 92 18:42:30 GMT
- Organization: Alias Research, Inc., Toronto ON Canada
-
- Danny W. McCampbell <danny@utkux1.utk.edu> asked about adding balloon
- help to his app.
-
- Peter N Lewis <peter@cujo.curtin.edu.au> replied:
- |Whatever you do, don't use BalloonWriter or you'll spend more time
- |fighting it than adding balloons!
- ...
- |The hdlg resource has items for each dialog item. There is a hdlg
- |item in the array for each DITL item, and each hdlg item has four
- |strings (STR# id, index pairs) attached to it (Normal, Disabled,
- |Checked, something else).
-
- This is fine as long as your balloon help strings are all less than
- 255 chars long. If they're longer, you should use TEXT [HMTEResItem]
- resources instead. Another advantage of using TEXT resources is that
- you can used 'styl' resources to style the text with different fonts,
- sizes, boldness etc. This can be a bad thing as well, since any font
- selected via Leium or whatever will be ignored. If you want to get
- REALLY fancy, you can use PICT [HMPictItem] resources and have nice
- colour diagrams in your explanations.
-
- I've always wondered if you could use a 'moov' resource. A little
- animation would make 3D revolves etc. easier to understand, that's for
- sure.
-
- Reid
- - --
- Reid Ellis
- rae@utcs.utoronto.ca || rae@Alias.com
- CDA0610@applelink.apple.com || +1 416 362 9181 [work]
-
- +++++++++++++++++++++++++++
-
- From: ross@bnr.ca (Ross Brown)
- Date: 4 Sep 92 14:41:42 GMT
- Organization: Bell-Northern Research
-
- In article <1992Sep3.184230.2332@alias.com> rae@Alias.com (Reid Ellis) writes:
- >[stuff deleted]
- >I've always wondered if you could use a 'moov' resource. A little
- >animation would make 3D revolves etc. easier to understand, that's for
- >sure.
-
- Yes, someone(s) at the MacHack gathering this summer presented just such a
- hack. Anyone with back issues of the TidBITS newsletter could find the
- reference for you. I don't keep them.
-
- ==============================================================================
- Ross Brown, Dept. 7C22 < Bell-Northern Research > Just the facts, ma'am.
- Advisor, Telemgmt Svcs < P. O. Box 3511, Station C > We don't care whose
- ross@bnr.ca < Ottawa, ON, Canada K1Y 4H7 > opinions yours aren't.
- ==============================================================================
-
- +++++++++++++++++++++++++++
-
- From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
- Organization: Kalamazoo College
- Date: Fri, 4 Sep 1992 16:21:13 GMT
-
- ross@bnr.ca (Ross Brown) writes:
- >rae@Alias.com (Reid Ellis) writes:
- >>I've always wondered if you could use a 'moov' resource. A little
- >>animation would make 3D revolves etc. easier to understand, that's for
- >>sure.
- >
- >Yes, someone(s) at the MacHack gathering this summer presented just such a
- >hack. Anyone with back issues of the TidBITS newsletter could find the
- >reference for you. I don't keep them.
-
- TidBITS doesn't seem to have anything about QuickTime in balloons.
- Leonard R.'s movie-for-a-finder-icon hack is mentioned (hey, Leonard,
- want to upload that somewhere?) but that's it.
-
- Maybe Wild Magic would let you substitute a movie for a PICT somehow?
- (I'm not into QuickTime; if this is a dumb idea, flame me in email.)
-
- You couldn't use the interface anyway, without seriously distorting the
- balloon help UI. Would continuously-looping balloon movies really be
- that informative?
- - --
- Jamie McCarthy Internet: k044477@kzoo.edu AppleLink: j.mccarthy
- The essence of OOP: "After some hacking, I finally got the program to
- work, but I'm still not sure why." - David Marcovitz (marcovitz@uiuc.edu)
-
- +++++++++++++++++++++++++++
-
- From: ross@bnr.ca (Ross Brown)
- Date: 8 Sep 92 15:46:13 GMT
- Organization: Bell-Northern Research
-
- In article <1992Sep4.162113.17663@hobbes.kzoo.edu> k044477@hobbes.kzoo.edu
- (Jamie R. McCarthy) writes:
- >TidBITS doesn't seem to have anything about QuickTime in balloons.
- >Leonard R.'s movie-for-a-finder-icon hack is mentioned (hey, Leonard,
- >want to upload that somewhere?) but that's it.
-
- You're right, Jamie, the movie was in a Finder icon, not in a balloon. My
- error. I think I'd rather see the movie in an icon, especially if you could
- turn the movie on and off by selecting/deselecting the icon.
-
- +++++++++++++++++++++++++++
-
- From: podenski@bcsaic.boeing.com (Patrick Podenski)
- Date: 9 Sep 92 22:13:20 GMT
- Organization: Boeing Computer Services AI Center, Seattle
-
- In article <1992Sep8.154613.10915@bmers95.bnr.ca> ross@bnr.ca (Ross Brown) writes:
- >In article <1992Sep4.162113.17663@hobbes.kzoo.edu> k044477@hobbes.kzoo.edu
- >(Jamie R. McCarthy) writes:
- >>TidBITS doesn't seem to have anything about QuickTime in balloons.
- >>Leonard R.'s movie-for-a-finder-icon hack is mentioned (hey, Leonard,
- >>want to upload that somewhere?) but that's it.
- >
- >You're right, Jamie, the movie was in a Finder icon, not in a balloon. My
- >error. I think I'd rather see the movie in an icon, especially if you could
- >turn the movie on and off by selecting/deselecting the icon.
-
- I attempted to place a QuickTime movie in balloon help within a Prograph
- application. It was very easy to do because Prograph has a very nice
- built-in balloon editor. However, when I bring up the balloon, there is
- no way to go and activate the QuickTime movie. I am using Wild Magic,
- which has a small icon which must be clicked to deploy the QuickTime
- movie controls. Once you mouse out of the object to which the balloon
- help corresponds, the balloon goes away. Therefore, I cannot click on
- the Wild Magic icon.
-
- I certainly can see the value of QuickTime in balloon help. I hope that
- someone will make it possible.
-
- ---------------------------
-
- From: rainwatr@ucbeh.san.uc.edu
- Subject: Problems in Macintosh Programming Secrets
- Date: 4 Sep 92 01:01:09 EST
- Organization: Univ. of Cincinnati Center for IT Services
-
- I'm trying to get the example programs to work from the Second Edition of
- Macintosh Programming Secrets by Scott Knaster and Keith Rollin. I'm having
- a little trouble with the program in Chapter 4, specifically with the changes
- to the MainEventLoop function in Standard Stuff.c. The line in question is:
-
- itemWasHit = DialogSelect(&event, &theDialog, &itemHit);
-
- When I try to compile the source file, I get the message " 'theDialog' has
- not been declared." There is another occurrance of 'theDialog' a couple of
- lines later, so I don't think it's a typo.
-
- As far as I can tell, there is no function prototype in any of the files
- for DialogSelect. I'm assuming there should be. (?)
-
- There were other variables in MainEventLoop that no declaration was listed
- for, including passToDialog, itemWasHit, and sleepyTime. I made some
- assumptions which I think are correct - I declared the first two as
- Booleans, and sleepyTime as a long.
-
- Anyway, can someone tell me what theDialog should be? A DialogPtr perhaps?
- Also, are there any other gotchas to watch out for in the rest of the book?
-
- Thanks for any info.
- - --
- Don Rainwater, Systems Manager, Univ. of Cincinnati Center for IT Services
- Don.Rainwater@UC.Edu
-
- +++++++++++++++++++++++++++
-
- From: keith@taligent.com (Keith Rollin)
- Organization: Taligent
- Date: Fri, 4 Sep 1992 07:15:39 GMT
-
- In article <1992Sep4.010109.1710@ucbeh.san.uc.edu>, rainwatr@ucbeh.san.uc.edu
- writes:
- >
- > I'm trying to get the example programs to work from the Second Edition of
- > Macintosh Programming Secrets by Scott Knaster and Keith Rollin. I'm having
- > a little trouble with the program in Chapter 4, specifically with the changes
- > to the MainEventLoop function in Standard Stuff.c. The line in question is:
- >
- > itemWasHit = DialogSelect(&event, &theDialog, &itemHit);
- >
- > When I try to compile the source file, I get the message " 'theDialog' has
- > not been declared." There is another occurrance of 'theDialog' a couple of
- > lines later, so I don't think it's a typo.
- >
- > As far as I can tell, there is no function prototype in any of the files
- > for DialogSelect. I'm assuming there should be. (?)
- >
- > There were other variables in MainEventLoop that no declaration was listed
- > for, including passToDialog, itemWasHit, and sleepyTime. I made some
- > assumptions which I think are correct - I declared the first two as
- > Booleans, and sleepyTime as a long.
- >
- > Anyway, can someone tell me what theDialog should be? A DialogPtr perhaps?
- >
-
- Sorry for the confusion there. Yes, "theDialog" should be a DialogPtr. Scott I
- and didn't want to waste pages and pages going into excrutiating detail on
- everything, so we left a few out in some places. Missing declarations whose
- types are obvious are such a place. In this case, you know that "theDialog" is a
- DialogPtr because that's what the Dialogs.h files says DialogSelect() takes as
- the second parameter.
-
- > Also, are there any other gotchas to watch out for in the rest of the book?
-
- You tell me.
-
- - --
- Keith Rollin
- Phantom Programmer
- Taligent, Inc.
-
-
- ---------------------------
-
- From: chuck@gte.com (Chuck Hoffman)
- Subject: Animated Cursor
- Date: 4 Sep 92 16:05:58 GMT
- Organization: GTE Laboratories
-
- Can someone point me to documentation about how to do an animated cursor.
- I somehow missed it in the TN's and IM.
-
- Thanks.
-
-
- Chuck Hoffman
- chuck@gte.com
- GTE Laboratories, Waltham, Massachusetts, USA
- (617) 466-2131
- =====================================
- I'm not sure why we're here, but I am sure that while we're here we're
- supposed to help each other.
- =====================================
-
- +++++++++++++++++++++++++++
-
- From: jbush@magnus.acs.ohio-state.edu (J Eric Bush)
- Organization: The Ohio State University
- Date: Fri, 4 Sep 1992 17:56:46 GMT
-
- In article <chuck-040992120527@choffman.gte.com> chuck@gte.com (Chuck Hoffman)
- writes:
- >Can someone point me to documentation about how to do an animated cursor.
- >I somehow missed it in the TN's and IM.
- >
- To do an animated cursor the way the Finder does it, you have a acur resource
- with the numbers of the CURS icons in the rotation. Make a copy of your finder
- and save it to disk. Look at the acur and CURS resource with ResEdit.
-
- Then, inyour application, you just keep a variable with the current cursor,
- add one to it, and then do a SetCursor procedure/function.
-
- Eric
- - --
- - ------------------------------------------------------------------------------
- J. Eric Bush
- Internet: jbush@magnus.acs.ohio-state.edu
-
- +++++++++++++++++++++++++++
-
- From: chuck@gte.com (Chuck Hoffman)
- Date: 9 Sep 92 12:53:01 GMT
- Organization: GTE Laboratories
-
- In article <1992Sep4.175646.10103@magnus.acs.ohio-state.edu>,
- jbush@magnus.acs.ohio-state.edu (J Eric Bush) wrote:
- >
- > To do an animated cursor the way the Finder does it, you have a acur resource
- > with the numbers of the CURS icons in the rotation. Make a copy of your finder
- > and save it to disk. Look at the acur and CURS resource with ResEdit.
- >
- > Then, inyour application, you just keep a variable with the current cursor,
- > add one to it, and then do a SetCursor procedure/function.
-
- Thanks, Eric. Sometimes when I look for something complicated, I miss the
- simple.
-
- Chuck Hoffman
- chuck@gte.com
- GTE Laboratories, Waltham, Massachusetts, USA
- (617) 466-2131
- =====================================
- I'm not sure why we're here, but I am sure that while we're here we're
- supposed to help each other.
- =====================================
-
- +++++++++++++++++++++++++++
-
- From: mbabramo@unix.amherst.edu (MICHAEL BERNARD ABRAMOWICZ)
- Date: 9 Sep 92 17:39:19 GMT
- Organization: Amherst College
-
-
- Hi there,
-
- Another possible approach is to use the Vertical Retrace Manager.
- This is pretty easy if you have New Inside Macintosh: Processes,
- since full source code is conveniently provided.
-
- Michael Abramowicz
-
- Disclaimer: I wrote the first version of the chapter as an Apple
- summer intern, so I am somewhat biased. But it really is easy.
-
- +++++++++++++++++++++++++++
-
- From: kent@sunfs3.Camex.COM (Kent Borg)
- Date: 9 Sep 92 22:42:32 GMT
- Organization: Camex Inc., Boston MA
-
- In article <BuBnpJ.AEu@unix.amherst.edu> mbabramo@unix.amherst.edu (MICHAEL BERNARD ABRAMOWICZ) writes:
- >Another possible approach is to use the Vertical Retrace Manager.
- >This is pretty easy if you have New Inside Macintosh: Processes,
- >since full source code is conveniently provided.
- >
- >Michael Abramowicz
- >
- >Disclaimer: I wrote the first version of the chapter as an Apple
- >summer intern, so I am somewhat biased. But it really is easy.
-
- And I didn't like it when I saw it. No, I have no gripes (or opinions
- actually) with the quality of the code, my complaint (often repeated
- here) is that a VBL task should *not* be used to spin a cursor. It is
- dishonest.
-
- Spinning cursors are not just there to be cute, they are to assure the
- user that things are still progressing, their speed and cadence can
- convey information about the progress of short procedures. (Long
- procedures should get cancelable progress thermometers, not spinning
- cursors.)
-
- If you use an effort-saving VBL to spin your cursor you are unlikely
- to put in the extra work needed to make the cursor representative of
- whether there really *is* any progress going on.
-
- Spinning cursors is not a background task, it is part of the Real Work
- of your application, do it in the Real Code. Save VBLs for background
- activities.
-
-
- - --
- Kent Borg kent@camex.com or (when it is *working*) kentborg@aol.com
- H:(617) 776-6899 W:(617) 426-3577
- As always, things look better when some costs are left out.
- -Economist 3-28-92 p. 94
-
- ---------------------------
-
- From: Andrew_Gilmartin@Brown.Edu (Andrew Gilmartin)
- Subject: Q: GrayRgn + Menu bar region
- Date: 6 Sep 92 20:38:06 GMT
- Organization: Brown University
-
- With WaitNextEvent() you can specify when to receive mouse
- moved messages by specifying a region within which you don't
- care about the mouse's movement but outside of which you do.
- When the mouse is outside of the front window, I only care to
- be notified when the mouse moves into the front window. This is
- simply done using a region that is the difference between the
- desktop and my window, for example
-
- RectRgn( theWindowRgn, &theWindowRect );
- XorRgn( GetGrayRgn(), theWindowRgn, theCursorRgn );
-
- The problem is that GetGrayRgn() excludes the menu bar and so I
- get mouse moved messages when the mouse moves there. Is there a
- clean way to get the full screen region (desktop and menu bar)?
- Thanks.
-
- - --
- Andrew Gilmartin
- Computing & Information Services
- Brown University
-
- Andrew_Gilmartin@Brown.Edu
- (401) 863-7305
-
- +++++++++++++++++++++++++++
-
- From: keith@taligent.com (Keith Rollin)
- Date: 6 Sep 92 23:44:43 GMT
- Organization: Taligent
-
- In article <18dq7eINN48i@stanley.cis.Brown.EDU>, Andrew Gilmartin
- <Andrew_Gilmartin@Brown.Edu> writes:
- >
- > With WaitNextEvent() you can specify when to receive mouse
- > moved messages by specifying a region within which you don't
- > care about the mouse's movement but outside of which you do.
- > When the mouse is outside of the front window, I only care to
- > be notified when the mouse moves into the front window. This is
- > simply done using a region that is the difference between the
- > desktop and my window, for example
- >
- > RectRgn( theWindowRgn, &theWindowRect );
- > XorRgn( GetGrayRgn(), theWindowRgn, theCursorRgn );
- >
- > The problem is that GetGrayRgn() excludes the menu bar and so I
- > get mouse moved messages when the mouse moves there. Is there a
- > clean way to get the full screen region (desktop and menu bar)?
- > Thanks.
-
- You don't need to be so selective. Instead of using GetGrayRgn(), create a
- wide-open region from -32000 to 32000 in both directions, and subtract the
- theWindowRgn from that. This technique will only cause problems if you move the
- mouse off of the desktop, which you can't, so it won't, so there.
-
- Here's how TESample on ftp.apple.com does it:
-
- /* Change the cursor's shape, depending on its position. This also calculates
- the region
- where the current cursor resides (for WaitNextEvent). When the mouse moves
- outside of
- this region, an event is generated. If there is more to the event than just
- Rthe mouse movedS, we get called before the event is processed to make sure
- the cursor is the right one. In any (ahem) event, this is called again before
- we
- fall back into WNE. */
-
- #pragma segment Main
- void AdjustCursor(mouse,region)
- Point mouse;
- RgnHandle region;
- {
- WindowPtr window;
- RgnHandle arrowRgn;
- RgnHandle iBeamRgn;
- Rect iBeamRect;
-
- window = FrontWindow(); /* we only adjust the cursor when we are in front */
- if ( (! gInBackground) && (! IsDAWindow(window)) ) {
- /* calculate regions for different cursor shapes */
- arrowRgn = NewRgn();
- iBeamRgn = NewRgn();
-
- /* start arrowRgn wide open */
- SetRectRgn(arrowRgn, kExtremeNeg, kExtremeNeg, kExtremePos, kExtremePos);
-
- /* calculate iBeamRgn */
- if ( IsAppWindow(window) ) {
- iBeamRect = (*((DocumentPeek) window)->docTE)->viewRect;
- SetPort(window); /* make a global version of the viewRect */
- LocalToGlobal(&TopLeft(iBeamRect));
- LocalToGlobal(&BotRight(iBeamRect));
- RectRgn(iBeamRgn, &iBeamRect);
- /* we temporarily change the portUs origin to RglobalfyS the visRgn */
- SetOrigin(-window->portBits.bounds.left, -window->portBits.bounds.top);
- SectRgn(iBeamRgn, window->visRgn, iBeamRgn);
- SetOrigin(0, 0);
- }
-
- /* subtract other regions from arrowRgn */
- DiffRgn(arrowRgn, iBeamRgn, arrowRgn);
-
- /* change the cursor and the region parameter */
- if ( PtInRgn(mouse, iBeamRgn) ) {
- SetCursor(*GetCursor(iBeamCursor));
- CopyRgn(iBeamRgn, region);
- } else {
- SetCursor(&qd.arrow);
- CopyRgn(arrowRgn, region);
- }
-
- DisposeRgn(arrowRgn);
- DisposeRgn(iBeamRgn);
- }
- } /*AdjustCursor*/
-
-
- - --
- Keith Rollin
- Phantom Programmer
- Taligent, Inc.
-
- ---------------------------
-
- From: rsilvers@powwow.nynexst.com (Rob Silvers)
- Subject: Need small example of playing a sound in THINK C.
- Date: 7 Sep 92 00:19:53 GMT
- Organization: Nynex Science and Technology
-
-
-
-
- I have gotton the Mac to play sampled sound resources in
- THINK C, but I am having trouble playing a synthesized square wave.
- Could someone send me a small example of playing a simple note?
-
- Thanks,
- --Rob.
-
- +++++++++++++++++++++++++++
-
- From: chuck@gte.com (Chuck Hoffman)
- Date: 9 Sep 92 14:19:17 GMT
- Organization: GTE Laboratories
-
- In article <1992Sep7.001953.570@nynexst.com>, rsilvers@powwow.nynexst.com
- (Rob Silvers) wrote:
- >
- > I have gotton the Mac to play sampled sound resources in
- > THINK C, but I am having trouble playing a synthesized square wave.
- > Could someone send me a small example of playing a simple note?
-
- I did it recently this way, to play a sound asynchronously:
-
- I used ResEdit to create (and preview play) a 'snd ' resource (trailing
- blank required) with the following hexidecimal values. Actually, I created
- a template for ResEdit to make this easy. Sound resource number should be
- above 8191. I used 9000.
-
- ============ 'snd ' RESOURCE:
-
- 0001 Format 1
- 0001 Number of mod/synth's is 1
- 000100000000 Note synth id is 1, and null initial parm
- 0003 Number of commands
- 002B00FF00000000 Amplitude command (full blast)
- 002C008000000000 Timbre command (half between square and sine)
- 002803E800000036 Note command (1000 half miliseconds, F-sharp/A-flat)
-
- ============ TO PLAY THE SOUND:
-
- SndCommand myCallbk;
-
- - ------------
- disposeAlmaMater = FALSE;
- myCallbk.cmd = callBackCmd;
- myCallbk.param1 = NIL;
- myCallbk.param2 = (long) &disposeAlmaMater;
- SetItem (myMenuHandle[3], AlmaMaterItem, myStifleStr);
- mySoundH = GetResource ('snd ', 9000);
- HLock (mySoundH);
- mySndChPtr = NIL;
- myErr = SndNewChannel (&mySndChPtr, NIL, NIL,
- (ProcPtr) myCallBack);
- myErr = SndPlay (mySndChPtr, mySoundH, TRUE);
- myErr = SndDoCommand (mySndChPtr, &myCallbk, TRUE);
-
- ============ TO STOP THE SOUND
-
- sndRC = SndDisposeChannel (mySndChPtr, TRUE);
- HUnlock (mySoundH);
- ReleaseResource (mySoundH);
- disposeAlmaMater = FALSE;
-
- ============ CALLBACK ROUTINE
-
- pascal void myCallBack(SndChannelPtr workChPtr, SndCommand workCmd)
- {
- *((Ptr) workCmd.param2) = (char) 0x08; /* set flag in disposeAlmaMater */
- return;
- }
-
- ============
-
- I'm a real beginner at this sound stuff, so postings of any other ways
- would be of interest to me as well.
-
-
- Chuck Hoffman
- chuck@gte.com
- GTE Laboratories, Waltham, Massachusetts, USA
- (617) 466-2131
- =====================================
- I'm not sure why we're here, but I am sure that while we're here we're
- supposed to help each other.
- =====================================
-
- ---------------------------
-
- From: johnsd2@jec324.its.rpi.edu (Daniel Norman Johnson)
- Subject: INIT Idea/Request
- Organization: Rensselaer Polytechnic Institute, Troy, NY.
- Date: Mon, 7 Sep 1992 19:17:08 GMT
-
- I am not sure this is the right place for this, but if it isn't, please
- flame in toward the right newsgroup. :)
-
- It occurs to me that it would be quite neat (to say the least) to get
- rid of this memory zone stuff in the Macintosh by making NewHandle
- act like TempNewHandle. Or more precisely, to make any call to NewHandle
- result in a call to TempNewHandle, and if that fails, a normal call
- to NewHandle.
-
- I tried to make an INIT that does this, but it failed miserably, and I
- don't understand these things well enough to know why, or to fix it. :(
-
- So, I just wanted to suggest that somebody out there with a clue about
- these matters give it a shot, or tell me its impossible (& why). :)
-
- Dat's all. Thanx fer listening. :)
- - --
- - Dan Johnson
- And God said "Jeeze, this is dull"... and it *WAS* dull. Genesis 0:0
-
- These opinions have had all identifiying marks removed, and are untraceable.
- You'll never know whose they are.
-
- +++++++++++++++++++++++++++
-
- From: gurgle@netcom.com (Pete Gontier)
- Date: Tue, 08 Sep 92 00:14:56 GMT
- Organization: cellular
-
- johnsd2@jec324.its.rpi.edu (Daniel Norman Johnson) writes:
-
- >It occurs to me that it would be quite neat (to say the least) to get
- >rid of this memory zone stuff in the Macintosh by making NewHandle
- >act like TempNewHandle. Or more precisely, to make any call to NewHandle
- >result in a call to TempNewHandle, and if that fails, a normal call
- >to NewHandle.
-
- This was discussed at length some months ago. Some guy who was Smarter
- Than All the Rest of Us Put Together pointed out that this was going
- to make some existing applications go crazy. Some do brilliant things
- like figure out how much memory is available to them and then allocate
- it all in one big block and do their own allocation schemes within that
- block. MacPaint 2 is one that springs to mind. Or perhaps MacWrite II.
- One of those.
- - --
- Pete Gontier // EC Technology // gurgle@netcom.com
-
- +++++++++++++++++++++++++++
-
- From: johnsd2@rs6110.ecs.rpi.edu (Daniel Norman Johnson)
- Date: 8 Sep 92 01:33:54 GMT
- Organization: Rensselaer Polytechnic Institute, Troy, NY.
-
- In article <t7qnaga.gurgle@netcom.com>, gurgle@netcom.com (Pete Gontier) writes:
- |> johnsd2@jec324.its.rpi.edu (Daniel Norman Johnson) writes:
- |>
- |> >It occurs to me that it would be quite neat (to say the least) to get
- |> >rid of this memory zone stuff in the Macintosh by making NewHandle
- |> >act like TempNewHandle. Or more precisely, to make any call to NewHandle
- |> >result in a call to TempNewHandle, and if that fails, a normal call
- |> >to NewHandle.
- |>
- |> This was discussed at length some months ago. Some guy who was Smarter
- |> Than All the Rest of Us Put Together pointed out that this was going
- |> to make some existing applications go crazy. Some do brilliant things
- |> like figure out how much memory is available to them and then allocate
- |> it all in one big block and do their own allocation schemes within that
- |> block. MacPaint 2 is one that springs to mind. Or perhaps MacWrite II.
- |> One of those.
-
- Why would this cause a problem? Sounds to me like it calls some Mem Manager
- routine to find out how much memory is in its zone, then allocates a block
- about that big. Is this not what you are saying?
-
- All taht would imply is that you ought to try to NewHandle before
- you TempNewHandle, or some such thing like that, so this allocation
- would (if possible) be in the app's zone instead of in temp memory
- (where it could get in the way)
-
- At the worst this just means there needs to be a mechanism for
- exceptions to the new memory-allocation arrangement, no?
- - --
- - Dan Johnson
- And God said "Jeeze, this is dull"... and it *WAS* dull. Genesis 0:0
-
- These opinions have had all identifiying marks removed, and are untraceable.
- You'll never know whose they are.
-
- +++++++++++++++++++++++++++
-
- From: bwilliam@iat.holonet.net (Bill Williams)
- Organization: HoloNet (BBS: 510-704-1058)
- Date: Wed, 9 Sep 1992 05:10:48 GMT
-
- I feel only very large blocks of memory that NEVER ar locked during a call
- to waitnextevent should be put in temporary memory.
-
- It sickens me to have to reboot all the time in system seven on a stock
- system on a 8 meg machine (not mine) because even after quitting nearly
- every application the damned free memory is fragmented AND LOCKED by
- foolish people who abuse temporary memory.
-
- BWilliams
-
-
- +++++++++++++++++++++++++++
-
- From: gurgle@netcom.com (Pete Gontier)
- Date: Wed, 09 Sep 92 06:04:39 GMT
- Organization: cellular
-
- bwilliam@iat.holonet.net (Bill Williams) writes:
-
- >I feel only very large blocks of memory that NEVER ar locked during a call
- >to waitnextevent should be put in temporary memory.
-
- That's the Apple dogma, as well as I remember.
-
- >It sickens me to have to reboot all the time in system seven on a stock
- >system on a 8 meg machine (not mine) because even after quitting nearly
- >every application the damned free memory is fragmented AND LOCKED by
- >foolish people who abuse temporary memory.
-
- No, it's bugs. Get the latest Tuner. I never have this problem, and I'm
- on my Mac all day every day.
- - --
- Pete Gontier // EC Technology // gurgle@netcom.com
-
- ---------------------------
-
- From: ulfis@cyklop.nada.kth.se (Anders Ulfheden)
- Subject: UseResFile() problems with CTB Tools
- Date: 7 Sep 92 23:52:18 GMT
- Organization: Royal Institute of Technology, Stockholm, Sweden
-
- I have a document from Apple (by Craig Hotchkiss and Chris Halim) that
- describes some hints when creating your own Choose dialog:
-
- ...
- Save CurResFile().
- Save the current grafPtr.
- Set the new grafPtr to the dialog.
- Set CurResFile() to the procID of the tool we're working with (the tool procID
- is also the refNum of the open file).
- ...
-
- But when I check with ResError() after UseResFile((**toolHandle).procID) I get
- error resFNotFound (-193) Resource file not found. Can anyone explain why?
- The tools handle is valid and the code works fine without UseResFile() stuff.
-
- Now, I really want to use the refNum to the actual tool and read some font
- resources. Do I manually have to locate the tool before doing this?
-
- Thanks for any help!
-
- ulfis
-
- PS: Thanks to all of you netters that helped me earlier with strange font and
- sizes in the Choose dialog. I'll post the complete code to the net when
- it's done and works! DS.
- - --
- +------------------------------------------------------------------------------
- | Anders Ulfheden
- | USENET: ulfis@nada.kth.se AppleLink: SW0429
- | Royal Institute of Technology
- | Stockholm, Sweden
-
- +++++++++++++++++++++++++++
-
- From: mspace@netcom.com (Brian Hall)
- Date: Mon, 07 Sep 92 23:55:16 GMT
- Organization: Netcom - Online Communication Services (408 241-9760 guest)
-
- ulfis@cyklop.nada.kth.se (Anders Ulfheden) writes:
- >Now, I really want to use the refNum to the actual tool and read some font
- >resources. Do I manually have to locate the tool before doing this?
-
- Not to be a pain, but why do you need to do that? The only reason I ever
- came up with for that was printing, but you can always TMPaint to a
- printer grafport for that.
-
- - --
-
- \ | / | Brian Hall mspace@netcom.com
- - : - | Mark/Space Softworks Applelink: markspace
- /|\ | America Online: MarkSpace
- |-+-| |
- /-\|/-\ | The tornado ate my powerbook.
-
- +++++++++++++++++++++++++++
-
- From: ulfis@cyklop.nada.kth.se (Anders Ulfheden)
- Organization: Royal Institute of Technology, Stockholm, Sweden
- Date: Tue, 8 Sep 1992 20:16:19 GMT
-
- In article <+7qn!n-.mspace@netcom.com> mspace@netcom.com (Brian Hall) writes:
- ulfis@cyklop.nada.kth.se (Anders Ulfheden) writes:
- >Now, I really want to use the refNum to the actual tool and read some font
- >resources. Do I manually have to locate the tool before doing this?
-
- Not to be a pain, but why do you need to do that? The only reason I ever
- came up with for that was printing, but you can always TMPaint to a
- printer grafport for that.
-
- The tool itself contains font information to be used in the tools settings
- dialog. I should read this information from the tool to make my custom choose
- dialog look good.
-
- Brian Hall mspace@netcom.com
-
- ulfis
- - --
- +------------------------------------------------------------------------------
- | Anders Ulfheden
- | USENET: ulfis@nada.kth.se AppleLink: SW0429
- | Royal Institute of Technology
- | Stockholm, Sweden
-
- +++++++++++++++++++++++++++
-
- From: bredell@tdb.uu.se (Mats Bredell)
- Date: 9 Sep 92 08:07:08 GMT
- Organization: Uppsala University Computing Center (UDAC)
-
- ulfis@cyklop.nada.kth.se (Anders Ulfheden) writes:
- :
- : The tool itself contains font information to be used in the tools settings
- : dialog. I should read this information from the tool to make my custom choose
- : dialog look good.
- :
-
- Most tools contain a 'finf' resource that tells what font, size and style to
- use for the settings dialog. I tried to use this resource, but found that
- some tools don't have it.
-
- What am I supposed to do if there isn't such a resource? The tool I found that
- was lacking this resource, apparently wanted Geneva 9. Should I set the font
- to Geneva 9 if I can't find this resource?
-
- /Mats
- - --
- Mats Bredell Mats.Bredell@udac.uu.se
- Uppsala University Computing Center (UDAC) Ph: +46 18 187817
- Department of medical systems Fax: +46 18 187825
- Sweden Think straight - be gay!
-
- +++++++++++++++++++++++++++
-
- From: leonardr@netcom.com (Leonard Rosenthol)
- Date: 9 Sep 92 17:12:53 GMT
- Organization: Netcom - Online Communication Services (408 241-9760 guest)
-
- In article <1992Sep9.080708.6006@tdb.uu.se> Mats.Bredell@udac.uu.se writes:
- >ulfis@cyklop.nada.kth.se (Anders Ulfheden) writes:
- >:
- >: The tool itself contains font information to be used in the tools settings
- >: dialog. I should read this information from the tool to make my custom choose
- >: dialog look good.
- >:
- >
- >Most tools contain a 'finf' resource that tells what font, size and style to
- >use for the settings dialog. I tried to use this resource, but found that
- >some tools don't have it.
- >
- That's true. Also, with System 7 there is a NEW resource type that is
- used by the xxChoose routines to track font/size information for a tool - the
- 'flst' resource. So what you now have to do is check system version - if
- 7 then look first for a 'flst' (Get1IndResource) and if you don't find it, then
- go for the 'finf'. Under 6, just get the 'finf'.
-
- >What am I supposed to do if there isn't such a resource? The tool I found that
- >was lacking this resource, apparently wanted Geneva 9. Should I set the font
- >to Geneva 9 if I can't find this resource?
- >
- If you don't find a 'finf' or 'flst' resource, then you should use
- either Geneva 9, or be internally cool and use the Script manager to load the
- the current application font & size.
-
- - --
- - -----------------------------------------------------------------------------
- Leonard Rosenthol Internet: leonardr@netcom.com
- Director of Advanced Technology AppleLink: MACgician
- Aladdin Systems, Inc. GEnie: MACgician
-
- ---------------------------
-
- From: danny@utkux1.utk.edu (Danny W. McCampbell)
- Subject: Drawing Icons in Modal Dialogs?
- Date: 8 Sep 92 17:09:30 GMT
- Organization: University of Tennessee
-
- Hi. I have a modal dialog that I want to draw an ICON resource
- in. The problem I have is I am getting the resource from an
- ICN# resource. How can I draw this ICN# resource as an ICON
- resource into a Modal Dialog? Any ideas would be greatly appreciated.
- Thanks in advance.
-
- Danny
- danny@utkux1.utk.edu
-
- +++++++++++++++++++++++++++
-
- From: wombat@claris.com (Scott Lindsey)
- Date: 9 Sep 92 23:21:36 GMT
- Organization: Claris Corporation, Vancouver WA
-
- In article <1992Sep8.170930.24746@utkux1.utk.edu>, danny@utkux1.utk.edu (Danny W. McCampbell) writes:
- >
- > Hi. I have a modal dialog that I want to draw an ICON resource
- > in. The problem I have is I am getting the resource from an
- > ICN# resource. How can I draw this ICN# resource as an ICON
- > resource into a Modal Dialog? Any ideas would be greatly appreciated.
-
- Try
-
- GetDItem(dlog, Item, &IType, &IHdl, &IRect);
- ReleaseResource(IHdl);
- IHdl = GetResource('ICN#', id);
- SetDItem(dlog, Item, IType, IHdl, &IRect);
-
- Since an ICON resource is a proper prefix of an ICN#, you shouldn't have any
- problems.
-
- - --
- Scott Lindsey <wombat@claris.com>
-
- ---------------------------
-
- From: ulfis@cyklop.nada.kth.se (Anders Ulfheden)
- Subject: CTB undocumented routines and Think Libs
- Organization: Royal Institute of Technology, Stockholm, Sweden
- Date: Tue, 8 Sep 1992 21:35:13 GMT
-
- The file <CommResources.h> contains the glue for some *undocumented* CTB
- routines:
-
- ...
- pascal Handle CRMGetToolResource (short procID, ResType theType, short theID);
- pascal void CRMReleaseToolResource (short procID, Handle theHandle);
- ...
- pascal OSErr CRMFindCommunications(short *vRefNum, long *dirID);
- ...
-
- When I use CRMGetToolResource() in my code (CommToolbox library added) I get
- a "undefined CRMGetToolResource" link error.
-
- I can't find any description in my Inside CTB (published 1991) or in
- MPW's 411 help file for the CTB. Can someone from Symantec or Apple help me
- out?
-
- Tnx!
-
- ulfis
- - --
- +------------------------------------------------------------------------------
- | Anders Ulfheden
- | USENET: ulfis@nada.kth.se AppleLink: SW0429
- | Royal Institute of Technology
- | Stockholm, Sweden
-
- +++++++++++++++++++++++++++
-
- From: leonardr@netcom.com (Leonard Rosenthol)
- Date: Wed, 09 Sep 92 00:50:28 GMT
- Organization: Netcom - Online Communication Services (408 241-9760 guest)
-
- In article <ULFIS.92Sep8223513@cyklop.nada.kth.se> ulfis@cyklop.nada.kth.se (Anders Ulfheden) writes:
- >The file <CommResources.h> contains the glue for some *undocumented* CTB
- >routines:
- >
- >...
- >pascal Handle CRMGetToolResource (short procID, ResType theType, short theID);
- >pascal void CRMReleaseToolResource (short procID, Handle theHandle);
- >...
- >pascal OSErr CRMFindCommunications(short *vRefNum, long *dirID);
- >...
- >
- >When I use CRMGetToolResource() in my code (CommToolbox library added) I get
- >a "undefined CRMGetToolResource" link error.
- >
- These routines are part of CTB 1.1, which is available as a separate
- library for Think, but should be part of the MPW 3.2 .o files. If you don't
- have the docs/library for the CTB 1.1, they are available on ftp.apple.com.
-
- - --
- - -----------------------------------------------------------------------------
- Leonard Rosenthol Internet: leonardr@netcom.com
- Director of Advanced Technology AppleLink: MACgician
- Aladdin Systems, Inc. GEnie: MACgician
-
-
- +++++++++++++++++++++++++++
-
- From: mspace@netcom.com (Brian Hall)
- Date: 9 Sep 92 03:33:24 GMT
- Organization: Netcom - Online Communication Services (408 241-9760 guest)
-
- leonardr@netcom.com (Leonard Rosenthol) writes:
- >In article <ULFIS.92Sep8223513@cyklop.nada.kth.se> ulfis@cyklop.nada.kth.se (Anders Ulfheden) writes:
- >>The file <CommResources.h> contains the glue for some *undocumented* CTB
- >>routines:
- >>
- >>...
- >>pascal Handle CRMGetToolResource (short procID, ResType theType, short theID);
- >>pascal void CRMReleaseToolResource (short procID, Handle theHandle);
- >>...
- >>pascal OSErr CRMFindCommunications(short *vRefNum, long *dirID);
- >>...
- >>
- >>When I use CRMGetToolResource() in my code (CommToolbox library added) I get
- >>a "undefined CRMGetToolResource" link error.
- >>
- > These routines are part of CTB 1.1, which is available as a separate
- >library for Think, but should be part of the MPW 3.2 .o files. If you don't
- >have the docs/library for the CTB 1.1, they are available on ftp.apple.com.
- >Leonard Rosenthol Internet: leonardr@netcom.com
-
- The 1.1 files come in MPW .o format. You need to run it past oConv (and
- create a vocabulary file if you want lower case in the names). I think I
- also had to make a small change to one of the header files in that package
- as well (or I got newer ones from the ETO CD - I forget).
-
- - --
-
- \ | / | Brian Hall mspace@netcom.com
- - : - | Mark/Space Softworks Applelink: markspace
- /|\ | America Online: MarkSpace
- |-+-| |
- /-\|/-\ | The tornado ate my powerbook.
-
- +++++++++++++++++++++++++++
-
- From: ulfis@cyklop.nada.kth.se (Anders Ulfheden)
- Date: 9 Sep 92 10:47:39 GMT
- Organization: Royal Institute of Technology, Stockholm, Sweden
-
- leonardr@netcom.com (Leonard Rosenthol) writes:
- > These routines are part of CTB 1.1, which is available as a separate
- >library for Think, but should be part of the MPW 3.2 .o files. If you don't
- >have the docs/library for the CTB 1.1, they are available on ftp.apple.com.
-
- Can you be more specific about the docs? I looked on ftp.apple.com yesterday,
- but did'nt find anything new that I don't already have. I got the HyperCard
- stacks from WWDC, but no info there about CRMGetToolResource().
-
- mspace@netcom.com (Brian Hall) writes:
- >The 1.1 files come in MPW .o format. You need to run it past oConv (and
- >create a vocabulary file if you want lower case in the names). I think I
- >also had to make a small change to one of the header files in that package
- >as well (or I got newer ones from the ETO CD - I forget).
-
- Thanks! I have ETO#8 so I'll look there. Any plans from Symantec to support
- this 1.1 version of CTB?
-
- ulfis
- - --
- +------------------------------------------------------------------------------
- | Anders Ulfheden
- | USENET: ulfis@nada.kth.se AppleLink: SW0429
- | Royal Institute of Technology
- | Stockholm, Sweden
-
- ---------------------------
-
- End of C.S.M.P. Digest
- **********************
-